﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using HCMServices.DTO;

namespace HCMServices.GUI
{
    /// <summary>
    /// Thông tin về dịch vụ hiển thị trong danh sách tìm kiếm
    /// </summary>
    public class Service
    {
        /// <summary>
        /// Return string of PlaceName from data
        /// </summary>
        public string Name 
        {
            get
            {
                return Data.PlaceName;
            }
        }

        /// <summary>
        /// Return string of Address from data
        /// </summary>
        public string Address 
        {
            get
            {
                return Data.NumberOfHome + " " + Data.StreetName;
            }
        }

        /// <summary>
        /// Return string of Ward And District in Ho Chi Minh from Data
        /// </summary>
        public string WardAndDistrict
        {
            get
            {
                return "Phường " + Data.WardName + ", Quận " + Data.DistrictName + ", Tp. Hồ Chí Minh";
            }
        }

        /// <summary>
        /// Return String Comment from data
        /// </summary>
        public string Comment
        {
            get
            {
                return Data.Comment;
            }
        }

        public string Gia
        {
            get
            {
                if (Detail != null && Detail.Cost != 0)
                    return Detail.Cost.ToString();
                else
                    return "";
            }
        }

        /// <summary>
        /// Get or set string of IconType
        /// </summary>
        public string IconType { get; set; }

        /// <summary>
        /// Get or set HardDataDTO 
        /// </summary>
        public DTO.HardDataDTO Data { get; set; }

        /// <summary>
        /// Get or set detail service
        /// </summary>
        public DetailServiceDTO Detail { get; set;}

        /// <summary>
        /// Mapping Data Service Name with image
        /// </summary>
        /// <param name="data">DTO.HardDataDTO need to mapping with image</param>
        public Service(DTO.HardDataDTO data)
        {
            this.Data = data;
            IconType = "/Images/cafe.png";
            switch (Data.ServiceName)
            {
                case "ATM":
                    IconType = "/Images/atm.png";
                    break;
                case "Bến xe bus":
                    IconType = "/Images/bus_station.png";
                    break;
                case "Bệnh viện":
                    IconType = "/Images/hospital.png";
                    break;
                case "Chợ":
                    IconType = "/Images/market.png";
                    break;
                case "Cơ quan hành chính":
                    IconType = "/Images/adminitrative.png";
                    break;
                case "Cửa hàng đồ gỗ":
                    IconType = "/Images/wood_shop.png";
                    break;
                case "Karaoke":
                    IconType = "/Images/karaoke.png";
                    break;
                case "Khách sạn":
                    IconType = "/Images/hotel.png";
                    break;
                case "Nhà hàng":
                    IconType = "/Images/restaurant.png";
                    break;
                case "Nhà trọ":
                    IconType = "/Images/motel.png";
                    break;
                case "Phòng khám":
                    IconType = "/Images/clinic.png";
                    break;
                case "Quán ăn":
                    IconType = "/Images/food_store.png";
                    break;
                case "Quán café":
                    IconType = "/Images/cafe.png";
                    break;
                case "Rạp chiếu phim":
                    IconType = "/Images/cinema.png";
                    break;
                case "Shop thời trang":
                    IconType = "/Images/fashion.png";
                    break;
                case "Tiệm hớt tóc":
                    IconType = "/Images/hair_salon.png";
                    break;
                case "Trạm xăng":
                    IconType = "/Images/gas_pump.png";
                    break;
                case "Trường học":
                    IconType = "/Images/school.png";
                    break;
                case "Công viên":
                    IconType = "/Images/park.png";
                    break;
                case "Cửa hàng kim khí điện máy":
                    IconType = "/Images/machine_store.png";
                    break;
                case "Siêu thị":
                    IconType = "/Images/super_market.png";
                    break;
                case "Sân bóng đá":
                    IconType = "/Images/football_stadium.png";
                    break;
                case "Sân vận động":
                    IconType = "/Images/stadium.png";
                    break;
                case "Bến xe":
                    IconType = "/Images/station.png";
                    break;
            }
        }
    }
}
